package com.nowc.week.w107_ak;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class c {

    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        solve();
        out.flush();
        out.close();
        br.close();
    }

    static void solve() throws IOException {
        String[] in = br.readLine().split(" ");
        int n = Integer.parseInt(in[0]);
        in = br.readLine().split(" ");
        long[] a = new long[n];
        long ans = 0;
        for (int i = 0; i < n; i++) {
             a[i] = Long.parseLong(in[i]);
             ans += find(a[i]);
         }
        out.println(ans);
    }

    static long find(long x) {
        double k = (Math.sqrt(1 + 8.0 * x) - 1) / 2.0;
        return (long) Math.ceil(k);
    }
}
